二进制串函数和操作符

最近更新时间: 2024-06-12 15:06:00

函数 返回类型 描述
string || string bytea 串连接
octet_length(string) int 二进制串中的字节数
overlay(string placing stringfrom int [for int]) bytea 替换子串
position(substring in string) int 指定子串的位置
substring(string [from int] [for int]) bytea 提取子串
trim([both] bytes from string) bytea 从 string 的开头或结尾删除只包含出现在 bytes 中的字节的最长串
btrim(stringbytea, bytesbytea) bytea 从 string 的开头或结尾删除只包含出现在 bytes 中的字节的最长串
decode(stringtext, formattext) bytea 从 string 中的文本表示解码二进制数据
encode(databytea, formattext) text 将二进制数据编码为一个文本表示
get_bit(string, offset) int 从串中抽取位
get_byte(string, offset) int 从串中抽取字节
length(string) int 二进制串的长度
md5(string) text 计算 string 的 MD5 哈希码,十六进制形式返回结果
set_bit(string,offset, newvalue) bytea 设置串中的位
set_byte(string,offset, newvalue) bytea 设置串中的字节